home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: New Zealand Amiga Users Group
/
New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).zip
/
New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).adf
/
StrucBrowser
/
sb.src.zoo
/
sbgfxbase.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-22
|
7KB
|
199 lines
/************************************************************************
* *
* SBGfxBase *
* *
* by David Annett, 3 Sutherland Ave, Upper Hutt, New Zealand *
* *
* 17 July 89 *
* *
*************************************************************************/
#include "sb.h"
extern int level;
extern struct GfxBase *GfxBase;
extern void PrGfxBase2();
extern void PrGfxBase3();
extern void PrGfxBase4();
void PrGfxBase(string, GBase) char *string; struct GfxBase *GBase;
{
static struct StructData structdata[] = {
{ " LibNode", "struct Library", 0, SZ(Library) },
{ " ActiView", "struct View *", 5, PTRSIZE },
{ "(copinit", "struct copinit *)", 5, PTRSIZE },
{ "(cia", "LONG)", 5, PTRSIZE },
{ "(blitter", "LONG)", 5, PTRSIZE },
{ "-LOFlist", "UWORD *" , 5, PTRSIZE },
{ "-SHFlist", "UWORD *", 5, PTRSIZE },
{ "(blthd", "struct bltnode *)", 5, PTRSIZE },
{ "(blttl", "struct bltnode *)", 5, PTRSIZE },
{ "(bsblthd", "struct bltnode *)", 5, PTRSIZE },
{ "(bsblttl", "struct bltnode *)", 5, PTRSIZE },
{ "(vbsrv", "Interrupt)", 0, SZ(Interrupt) },
{ "(timsrv", "Interrupt)", 0, SZ(Interrupt) },
{ "(bltsrv", "Interrupt)", 0, SZ(Interrupt) },
{ " TextFonts", "struct List", 0, SZ(List) },
{ "(DefaultFont", "struct TextFont *)", 5, PTRSIZE }
};
int sum, choice = -1;
level++;
while (choice) {
sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, 0);
switch (choice = GetChoice(MAXGADG + 1)) {
case 1:
PrLibrary ("Graphics base library node", &GBase->LibNode);
break;
case 2:
if (GBase->ActiView)
PrView ("The currently active view", GBase->ActiView);
break;
case 15:
PrList ("TextFonts List structure", &GBase->TextFonts);
break;
case MOREGADG:
PrGfxBase2(" GfxBase (page 2)", GBase, sum);
break;
}
}
level--;
}
void PrGfxBase2(string, GBase, offset) char *string; struct GfxBase *GBase;
int offset;
{
static struct StructData structdata[] = {
{ " Modes", "UWORD", 12, INTSIZE },
{ "-VBlank", "BYTE", 3, BYTESIZE },
{ "-Debug", "BYTE", 3, BYTESIZE },
{ "-BeamSync", "SHORT", 2, INTSIZE },
{ " sys_bplcon0", "SHORT", 2, INTSIZE },
{ "-SpriteRes", "UBYTE", 3, BYTESIZE },
{ "-byteres", "UBYTE", 3, BYTESIZE },
{ "-Flags", "USHORT", 12, INTSIZE },
{ "-BlitLock", "SHORT", 2, INTSIZE },
{ "-BlitNest", "SHORT", 2, INTSIZE },
{ " BlitWaitQ", "struct List", 0, SZ(List) },
{ "(BlitOwner", "struct Task *)", 5, PTRSIZE },
{ " TOF_WaitQ", "struct List", 0, SZ(List) },
{ " DisplayFlags", "UWORD", 2, INTSIZE },
{ "(SimpleSprite", "struct SmSprite **)", 5, PTRSIZE },
{ "-MaxDspRow", "UWORD", 2, INTSIZE }
};
static char *flagnames[16] = {
NULL, "ERSY", "LACE", "LPEN",
NULL, NULL, NULL, NULL,
"GAUD", "COLOR", "DBLPF", "HOMOD",
"BPU0", "BPU1", "BPU2", "HIRES"
};
static char *Dflgnames[16] = {
"NTSC", "GENLOC", "PAL"
};
int sum, choice = -1;
UWORD bits;
level++;
while (choice) {
sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, offset);
switch (choice = GetChoice(MAXGADG + 1)) {
case 1:
bits = GfxBase->Modes;
FlagPrint("Display mode first blpcom0",flagnames,(ULONG)bits);
break;
case 5:
bits = GfxBase->system_bplcon0;
FlagPrint("'or'ed into each blpcon0 for display",flagnames,(ULONG)bits);
break;
case 11:
PrList ("BlitWaitQ List structure", &GBase->BlitWaitQ);
break;
case 13:
PrList ("TOF_WaitQ List structure", &GBase->TOF_WaitQ);
break;
case 14:
bits = GfxBase->DisplayFlags;
FlagPrint("Display Flags",Dflgnames,(ULONG)bits);
break;
case MOREGADG:
PrGfxBase3(" GfxBase (page 3)", GBase, sum);
break;
}
}
level--;
}
void PrGfxBase3(string, GBase, offset) char *string; struct GfxBase *GBase;
int offset;
{
static struct StructData structdata[] = {
{ "-MaxDspColumn", "UWORD", 12, INTSIZE },
{ "-NorDspRow", "UWORD", 12, INTSIZE },
{ "-NorDspColumn", "UWORD", 12, INTSIZE },
{ "-NormalDPMX", "UWORD", 12, INTSIZE },
{ "-NormalDPMY", "UWORD", 12, INTSIZE },
{ "(LastChanceMem","struct SigSemaph *)", 5, PTRSIZE },
{ "-LCMptr", "UWORD *", 5, PTRSIZE },
{ "-MicrosPerLine","UWORD", 12, INTSIZE },
{ "-MinDisplayCol","UWORD", 12, INTSIZE },
{ " reserved[2]", "ULONG", 0, PTRSIZE * 2 },
{ " hedley[4]", "ULONG", 0, PTRSIZE * 4 },
{ " hedley2[4]", "ULONG", 0, PTRSIZE * 4 },
{ "-hedley_count", "SHORT", 2, INTSIZE },
{ "-hedley_flags", "USHORT", 2, INTSIZE },
{ "-hedley_count1","SHORT", 2, INTSIZE },
{ "-hedley_tmp", "SHORT", 2, INTSIZE }
};
int sum, choice = -1;
level++;
while (choice) {
sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, offset);
switch (choice = GetChoice(MAXGADG + 1)) {
case 10:
HexDump("Hexdump of GfxBase reserved Long words",&GfxBase->reserved[0],
PTRSIZE, (long)PTRSIZE * 2);
break;
case 11:
HexDump("Hexdump of GfxBase hedley Long words",&GfxBase->hedley[0],
PTRSIZE, (long)PTRSIZE * 4);
break;
case 12:
HexDump("Hexdump of GfxBase hedley2 Long words",&GfxBase->hedley2[0],
PTRSIZE, (long)PTRSIZE * 4);
break;
case MOREGADG:
PrGfxBase4(" GfxBase (page 4)", GBase, sum);
break;
}
}
level--;
}
void PrGfxBase4(string, GBase, offset) char *string; struct GfxBase *GBase;
int offset;
{
static struct StructData structdata[] = {
{ " hedley3[3]", "ULONG", 0, PTRSIZE * 4 },
{ " hedley_spr[4]","ULONG", 0, PTRSIZE * 4 },
{ " hedley_sp1[4]","ULONG", 0, PTRSIZE * 4 }
};
int sum, choice = -1;
level++;
while (choice) {
sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, offset);
switch (choice = GetChoice(DATASIZE)) {
case 1:
HexDump("Hexdump of GfxBase hedley3 Long words",&GfxBase->hedley3[0],
PTRSIZE, (long)PTRSIZE * 3);
break;
case 2:
HexDump("Hexdump of GfxBase hedley_sprites Long words",
&GfxBase->hedley_sprites[0], PTRSIZE, (long)PTRSIZE * 4);
break;
case 3:
HexDump("Hexdump of GfxBase hedley_sprites1 Long words",
&GfxBase->hedley_sprites1[0], PTRSIZE, (long)PTRSIZE * 4);
break;
case MOREGADG:
break;
}
}
level--;
}